﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StartStop.ServiceResources
{
    #region User Resources
    public class MessageResponse
    {
        public bool Success { get; set; }
        public Int64 ReturnID { get; set; }
        public Guid ReturnGUID { get; set; }
        public string Message { get; set; }
    }

    public class ValidatedUserInfo
    {
        public bool Validated { get; set; }
        public Guid UserGUID { get; set; }
        public Int64 UserID { get; set; }
        public string Username { get; set; }
        public string EmailAddress { get; set; } 
    }
    #endregion

    #region Developer Resources

    public class Developer
    {
        public Int64 DeveloperID { get; set; }
        public Guid DeveloperGUI { get; set; }
        public Int64 UserID { get; set; } 
        
        public Guid AccessKey { get; set; }
        public Guid DevAccessKey { get; set; } 
        public string SiteURL { get; set; }
        public string Description { get; set; } 

        public enum DevType { Website = 1, Game = 2, App = 3, Other = 4 } 
        public DevType Type { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime ModifiedOn { get; set; }
        public DateTime LastAccessed { get; set; }
        public bool Approved { get; set; }
        public bool SPAM { get; set; } 
        
    }

    #endregion 

    #region UserPreferences
    public class Setting
    {
        public Int64 SettingID { get; set; }
        public Int64 UserID { get; set; }
        public int PreferenceType { get; set; }
        public string PreferenceName { get; set; }
        public bool PreferenceBool { get; set; }
        public int PreferenceInt { get; set; }
        public string PreferenceString { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime ModifiedOn { get; set; }

    }

    public class UserSettings
    {
        public Int64 UserID { get; set; }
        public List<Setting> Settings { get; set; }
    }
    #endregion

    #region Detailed Stat Resources
    public class StatOverView
    {
        public Int64 OverviewID { get; set; }
        public Guid OverviewGUID { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime ModifiedOn { get; set; }
        public string MoreInfoURL { get; set; }
        public Guid DeveloperGUID { get; set; }
        public Int64 DeveloperID { get; set; } 
        public enum OverviewType { Website = 1, OnlineGame=2, PS3=3, Xbox=4, Application=5, Game=6  };
        public OverviewType TypeOfOverview { get; set; }

        // This has not been implemented yet. 
        public SiteImage AssociatedImage { get; set; } 

    }

    public class StatDescription
    {
        public Int64 DetailStatID { get; set; }
        public Guid DetailStatGUID { get; set; }
        public string Name { get; set; }
        public string Description { get; set; } 

        public enum StatCreatedTyped { System = 1, Webservice = 2, Developer = 3 };
        public StatCreatedTyped CreatedByType { get; set; }

        public enum StatDateType { Number = 1, Percent = 2, Date = 3, String = 4, Music = 5 };
        public StatDateType DataType { get; set; }

        public Guid DeveloperGUID { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime ModifiedOn { get; set; }

        public Int64 OverviewID { get; set; }

    }

    public class UserStatLog
    {
        public Int64 DetailedStatLogID { get; set; }
        public Guid UserGuid { get; set; }
        public Guid DetailedStatGuid { get; set; }
        public Guid DetailedStatOverviewGUID { get; set; }
        public Int64 Count { get; set; }
        
        public string Note { get; set; }
        public Decimal Percent { get; set; }
        public DateTime SpecificDate { get; set; }
        public DateTime LoggedDate { get; set; }

        // If the data type is 5 then we're linking to an audio record
        public Int64 AudioContentID { get; set; } 

        // These fields are not mapped from the DB but are realised in realtime
        public Int64 UserStatRank { get; set; } 
    }

    
    public class UserStatLogWithDetail
    {
        public Dictionary<StatDescription, UserStatLog> StatList { get; set; } 
    }

    public class AudioContent
    {
        public Int64 AudioContentID { get; set; }
        public Guid AudioContentGUID { get; set; }
        public string SongTitle { get; set; }
        public string AlbumnTitle { get; set; }
        public string Genre { get; set; }
        public int Rating { get; set; }
        public string Notes { get; set; }
        public DateTime Year { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime ModifiedOn { get; set; }
        public Int64 ReportingUserID { get; set; } 
    }

    #endregion

    #region Windows Usage


    public class Usage
    {
        public string TypeOfUse { get; set; }
        public TimeSpan TotalTime { get; set; }
        public int RankedAgainst { get; set; }

    }
    #endregion

    #region trophys

    public class UserTrophy
    {
        public Int64 TrophyID { get; set; }
        public DateTime AwardedOn { get; set; }
        public bool? AwardedYet { get; set; }
        public int? PercentageComplete { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public Int64 UserID { get; set; }
        public string Username { get; set; }
        public string AvatarURL { get; set; } 


        public string Condition { get; set; }


        public int? UserAwardedCount { get; set; }
    }


   

    public class AppTrophy
    {
        public int TrophyID { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public string Condition { get; set; }
    }

    public class Trophy
    {
        public int TrophyID { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public string Condition { get; set; }
        public string ImageLink { get; set; }
        public string TriggerSQL { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime ModifiedOn { get; set; } 
        public string TriggerValue { get; set; }
        public Int64 DeveloperID { get; set; }
        public bool Approved { get; set; }
        public int? UserAwardedCount { get; set; }
    }

    public class TrophyDetailStatLink
    {
        public Int64 LinkID { get; set; }
        public Int64 TrophyID { get; set; }
        public Int64 OverviewID { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime ModifiedOn { get; set; } 
    }


    #endregion

    #region Rankings
    public class StatRanking
    {
        public Int64 UserID { get; set; }
        public string Username { get; set; }
        public Int64 Rank { get; set; }
        public Int64 Count { get; set; } 
    }

    public class ListOfRanking
    {
        public StatOverView Overview { get; set; }
        public StatDescription SpecificStatDescription { get; set; } 
        public List<StatRanking> Rankings { get; set; } 
    }

    #endregion 

    #region Images
    public class SiteImage
    {
        public Int64 ImageID { get; set; }
        public Guid ImageGUID { get; set; }
        public Guid LinkedGUID { get; set; }
        public Int64 LinkedID { get; set; }
        public string FileName { get; set; }

        public enum TypeOfImage { UserAvatar = 1, ApplicationImage = 2, DetailStatImage = 3, OtherAvatar = 5 }
        public TypeOfImage ImageType { get; set; }
        public string Location { get; set; }
        public enum SizeOfImage { small = 1, medium = 2, large = 3, supersize = 4 }
        public SizeOfImage ImageSize { get; set; } 
    }

    #endregion 

    #region ErrorLog

    public class ErrorEvent
    {
        public DateTime CreatedOn { get; set; }
        // WS1Point5 will be deprecated 
        public enum ErrorOriginatedFrom { UserSite = 1, DeveloperSite = 2, RPCWebservice = 3, RESTWebservice = 4, WindowsApp = 5, GenericApp = 6, Ws1point5 = 1000 }
        public ErrorOriginatedFrom ErrorFrom { get; set; }
        public string ErrorMessage { get; set; }
        public string ErrorDetail { get; set; }
        public string DBObject { get; set; }
        public string DBError { get; set; }
        public string Method { get; set; }

        public enum ErrorLevelType { Critical = 1, NotSoCritical = 2, Warning = 3, Message = 4 }

        public ErrorLevelType ErrorLevel { get; set; } 
    }

#endregion 


#region Other Things Like Tasls

    public class Tasks
    {
        public Guid TaskID { get; set; }
        public int TaskStatus { get; set; }
        public Int64 OverviewID { get; set; }
        public string DataToRun { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime ModifiedOn { get; set; }
        public DateTime FinishedExecutionOn { get; set; }
        public string OtherType { get; set; } 
    }
#endregion 
}
